package com.cnfangmao.masterdata.dao;

import java.util.List;

import org.apache.ibatis.annotations.Select;


import com.cnfangmao.masterdata.model.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * <p>
 * 角色表 Mapper 接口
 * </p>
 *
 * @author chenxd
 * @since 2020-04-17
 */
public interface RoleDao extends BaseMapper<Role> {
	@Select("select * from t_role r inner join t_account_role ru on r.role_id = ru.role_id where ru.user_id = #{userId}")
	List<Role> listByUserId(String userId);
	
	@Select("select * from t_role  where role_name = #{roleName}")
	Role findByRoleName(String roleName);
	
	List<Role> getAllRoles();
}
